<template>
	<view>
		<u-navbar :placeholder="true" :title="title" :autoBack="true"></u-navbar>
		<view class="content" v-html="detail.content"></view>
	</view>
</template>

<script>
	import { articleDetails  } from '@/common/api.js'
	
	export default {
		data() {
			return {
				title: '文章详情',
				detail: {}
			}
		},
		onLoad(params) {
			this.getDetail(params.id)
		},
		methods: {
			getDetail(id){
				articleDetails({id}).then(res => {
					this.title = res.title ?? "文章详情"
					this.detail = res
				})
			}
		}
	}
</script>

<style scoped>
	.content { padding: 30rpx; }
</style>
